﻿using System;

namespace FamilyBudgetManager.Domain
{
    public class Record
    {
        public virtual int Id { get; set; }
        public virtual Group Group { get; set; }
        public virtual SubGroup SubGroup { get; set; }
        public virtual Account Account { get; set; }
        public virtual Member Member { get; set; }
        public virtual DateTime Date { get; set; }
        public virtual decimal Amount { get; set; }
        public virtual bool Active { get; set; }

        public virtual Transfer Transfer { get; set; }
        public virtual RecurringSchedule RecurringSchedule { get; set; }

        public override string ToString()
        {
            return string.Format("Id: {0}\nAccount: {1}\nGroup: {2}\n  SubGroup: {3}\nMember: {4}\nAmount: {5}\nActive: {6}",
                Id,
                Account == null ? "(none)" : Account.Name,
                Group == null ? "(none)" : Group.Name,
                SubGroup == null ? "(none)" : SubGroup.Name,
                Member == null ? "(none)" : Member.Name,
                Amount.ToString("#.##0.00"),
                Active ? "Yes" : "No");
        }
    }
}
